package cn.globalph.housekeeper.data.retrofit

import cn.globalph.housekeeper.data.model.*
import cn.globalph.housekeeper.data.params.*
import okhttp3.RequestBody
import retrofit2.http.*

interface Api {

    //检查更新
    @GET("app/android/{versionCode}")
    suspend fun checkUpdate(
        @Path("versionCode") versionCode: Int
    ): BaseModel<UpdateModel>

    //验证手机号是否注册
    @GET("user/register/{phone}")
    suspend fun checkPhoneValidation(@Path("phone") phone:String):BaseModel<Boolean>

    //密码登陆
    @POST("user/login")
    suspend fun loginByPassword(@Body loginParams: LoginParams):BaseModel<LoginModel>

    //获取验证码
    @POST("user/validationCode")
    suspend fun sendCode(@Body param:CodeParam):BaseModel<String>

    //验证码登陆
    @POST("user/vcLogin")
    suspend fun loginByCode(@Body param:LoginCodeParam):BaseModel<LoginModel>

    //获取用户完整信息
    @GET("user/profile/all")
    suspend fun getCompleteProfile():BaseModel<ProfilesModel>

    //切换角色
    @POST("user/profile/{providerid}/{roleid}")
    suspend fun switchRole(@Path("providerid")providerid:String,@Path("roleid")roleid:String):BaseModel<LoginModel>

    //服务日历
    @GET("service/detail/daily/{date}")
    suspend fun getDailyTasks(@Path("date")date:String):BaseModel<List<Task>>

    //开始服务
    @POST("service/start")
    suspend fun startService(@Body param: StartTaskParam):BaseModel<StartServerModel>

    //上传定位
    @POST("location")
    suspend fun uploadLocation(@Body param:LocationParam):BaseModel<String>

    //获取房间数
    @GET("address/detail/{id}")
    suspend fun getCustomRoomInfo(@Path("id")id:String):BaseModel<RoomInfoModel>

    //获取检查情况
    @GET("service/check/{id}")
    suspend fun getCheckInfo(@Path("id")id:String):BaseModel<String>

    //上传房间数
    @POST("address/detail/{id}")
    suspend fun uploadRoomInfo(@Path("id")id:String,@Body param:RoomInfoParam):BaseModel<String>

    //上传检查
    @POST("/service/check/{id}")
    suspend fun uploadCheck(@Path("id")id:String):BaseModel<String>

    //获取上传用户签名需要的token
    @GET("/upload/token")
    suspend fun getCustomSignToken(@Query("fileName") fileName:String):BaseModel<CustomSignModel>

    @POST
    suspend fun uploadCustomSign(@Url url:String,@Body body:RequestBody)

    @POST("service/customer/sign")
    suspend fun uploadCustomSignData(@Body param:SignDataParam):BaseModel<StartServerModel>



}